
package at.jku.ce.stockexchange.service;

/**
 * Please modify this class to meet your needs
 * This class is not complete
 */

import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;

import javax.xml.namespace.QName;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.ws.RequestWrapper;
import javax.xml.ws.ResponseWrapper;

import at.jku.ce.juddi.UddiManager;

/**
 * This class was generated by Apache CXF 2.3.7
 * 2013-12-08T16:00:29.684+01:00
 * Generated source version: 2.3.7
 * 
 */
public final class ExchangeService_ExchangeServicePort_Client {

    private static final QName SERVICE_NAME = new QName("http://service.stockexchange.ce.jku.at/", "ExchangeServiceService");

    private ExchangeService_ExchangeServicePort_Client() {
    }

    public static void main(String args[]) throws java.lang.Exception {

        
        UddiManager manager = UddiManager.getInstance();
        //manager.publish("L6", "Stock Exchange Service", "http://140.78.73.106:8080/GroupL6StockExchange/services/ExchangeServicePort?wsdl");
        //manager.deletePublishedBusinessFromUDDI("L6");
        for(String wsdlURL : manager.getAllPublishedAccessPoints()){
        	ExchangeServiceService ss = new ExchangeServiceService(new URL(wsdlURL), SERVICE_NAME);
            ExchangeService port = ss.getExchangeServicePort();  
            
            System.out.println("WSDL: "+ wsdlURL);
            for(Stock s : port.getTradedStocks()){
            	System.out.println("Exchange exec: "+ s.getName());
            }
        }
      
        
  
        //automatically created code for testing of services 
//        {
//        System.out.println("Invoking buyStock...");
//        java.lang.String _buyStock_arg0 = "_buyStock_arg0948580001";
//        int _buyStock_arg1 = 223271767;
//        at.jku.ce.stockexchange.service.Exchange _buyStock__return = port.buyStock(_buyStock_arg0, _buyStock_arg1);
//        System.out.println("buyStock.result=" + _buyStock__return);
//
//
//        }
//        {
//        System.out.println("Invoking getExchanges...");
//        java.util.List<at.jku.ce.stockexchange.service.Exchange> _getExchanges__return = port.getExchanges();
//        System.out.println("getExchanges.result=" + _getExchanges__return);
//
//
//        }
//        {
//        System.out.println("Invoking sellStock...");
//        java.lang.String _sellStock_arg0 = "_sellStock_arg052090270";
//        int _sellStock_arg1 = -2006367537;
//        port.sellStock(_sellStock_arg0, _sellStock_arg1);
//
//
//        }
//        {
//        System.out.println("Invoking getStock...");
//        java.lang.String _getStock_arg0 = "_getStock_arg02096356099";
//        at.jku.ce.stockexchange.service.Stock _getStock__return = port.getStock(_getStock_arg0);
//        System.out.println("getStock.result=" + _getStock__return);
//
//
//        }
//        {
//        System.out.println("Invoking getTradedStocks...");
//        java.util.List<at.jku.ce.stockexchange.service.Stock> _getTradedStocks__return = port.getTradedStocks();
//        System.out.println("getTradedStocks.result=" + _getTradedStocks__return);
//
//
//        }
//        {
//        System.out.println("Invoking reset...");
//        port.reset();
//
//
//        }

        System.exit(0);
    }

}
